using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Compact13StartMenu
{
    public partial class Params : Form
    {
        public Params()
        {
            InitializeComponent();
            this.Left = (Screen.PrimaryScreen.WorkingArea.Width - this.Width) / 2;
            this.Top = (Screen.PrimaryScreen.WorkingArea.Height - this.Height) / 2;
            this.textBox1.Text = "";
            Args = "";
            
        }

        public static string Args { get; set; }

        public static DialogResult ShowAsDialog()
        {
            Params paramsDialog = new Params();
            DialogResult result = paramsDialog.ShowDialog();
            return result;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            textBox1.Text += " /d";
            cmdStart.Enabled = false;
        }

        private void cmdStart_Click(object sender, EventArgs e)
        {
            textBox1.Text = "start";
            cmdSlashD.Enabled = false;
        }

        private void cmdOK_Click(object sender, EventArgs e)
        {
            ExitOk();
        }

        private void cmdCancel_Click(object sender, EventArgs e)
        {
            ExitCancel();
        }


        protected void ExitOk()
        {
            if (cmdOK.Enabled == true)
            {
                if (OnOk())
                {
                    Args = textBox1.Text + " /d";
                    this.DialogResult = DialogResult.OK;
                    this.Close();
                }
            }
        }

        protected void ExitCancel()
        {
            if (cmdCancel.Enabled == true)
            {
                if (OnCancel())
                {
                    this.DialogResult = DialogResult.Cancel;
                    this.Close();
                }
            }
        }



        protected virtual bool OnOk()
        {
            return true;
        }

        protected virtual bool OnCancel()
        {
            return true;
        }






    }
}